<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateJobApplyScoresTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('job_apply_scores', function (Blueprint $table) {
//            $table->comment('岗位竞聘打分表');
            $table->increments('id');
            $table->integer('job_apply_id')->default(0)->index('job_apply_id_index');
            $table->integer('scale_id')->default(0);
            $table->boolean('type')->default(false)->comment('1-申报理由分 2-发展性项目分');
            $table->float('scores', 5, 1)->default(0)->comment('得分');
            $table->integer('b_user_id')->default(0)->comment('被评人id');
            $table->integer('p_user_id')->default(0)->comment('评分人id');
            $table->string('p_user_name', 25)->default('')->comment('评分人姓名');
            $table->timestamp('created_at')->nullable()->useCurrent();
            $table->timestamp('updated_at')->useCurrentOnUpdate()->nullable()->useCurrent();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('job_apply_scores');
    }
};
